package com.smartcruise.main.selfFragment.setting;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.widget.TextView;

import com.smartcruise.R;
import com.smartcruise.base.BaseTitleFragment;
import com.smartcruise.base.TitleBuilder;

import butterknife.BindView;
import butterknife.Unbinder;

/**
 * Created by FengChaoQun
 * on 2018/1/20 0020
 * 关于APP
 */

public class AboutAppFragment extends BaseTitleFragment {
    @BindView(R.id.text)
    TextView text;
    Unbinder unbinder;

    @Override
    protected void init() {
        setCloseActivity();
        PackageManager manager = getActivity().getPackageManager();
        PackageInfo info;
        try {
            info = manager.getPackageInfo(getActivity().getPackageName(), 0);
            text.append("\n\n当前版本:  " + info.versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    @Override
    protected int getContentLayout() {
        return R.layout.fragment_contain_about_app;
    }

    @Override
    protected TitleBuilder getTitleBuilder() {
        return TitleBuilder.create(true, getString(R.string.aboutApp));
    }

}
